<%@ page import="java.util.Enumeration" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<html>
<head>
    <title></title>
</head>
<body>
<table width="100%" border="2" cellpadding="5" cellspacing="0">
    <tr>
        <th>请求头参数名称</th>
        <th>参数值</th>
    </tr>
    <%
        response.setContentType("text/html;charset=utf-8");
        request.setCharacterEncoding("utf-8");
        //取出请求头参数，并遍历
        Enumeration<String> headerNames = request.getHeaderNames();
        // 遍历
        while (headerNames.hasMoreElements()) {
            // 获取参数名
            String name = headerNames.nextElement();
            // 根据参数名获取参数值
            String value = request.getHeader(name);
            // 打印到表格中
            out.write("<tr><td>"+name+"</td><td>"+value+"</td></tr>");
        }
    %>
</table>
</body>
</html>